package classFourth;

import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		System.out.print("input student count:");
		Scanner input=new Scanner(System.in);
		
		int n=input.nextInt();
		Student stu[]=new Student[10];
		for(int i=1;i<=n;i++) {
			System.out.print("input no "+i+" student name:");
			String name=input.next();
			System.out.print("input no "+i+" student grade:");
			int grade=input.nextInt();
			
			
			
			System.out.print("input no "+i+" student course count:");
			int coursecount=input.nextInt();
			
			Course course[]=new Course[coursecount+1];
			for(int j=1;j<=coursecount;j++) {
				System.out.print("input no "+j+" course name:");
				String coursename=input.next();
				System.out.print("input no "+j+" course hour:");
				int coursehour=input.nextInt();
				course[j]=new Course(coursename,coursehour);					
			}
			stu[i]=new Student(name,grade,course,coursecount);
		}
		
		for(int i=1;i<=n;i++) {
			System.out.println("no "+i+" student information:");
			stu[i].showMessage();
		}

	}

}
